<template>
  <view class="order-confirm">
    <!-- 配送方式 -->
    <view class="take-type">
      <view @tap="typeClick('1')" :class="takeType=='1'?'a-type':''"> 商品配送 </view>
      <view @tap="typeClick('2')" :class="takeType=='2'?'a-type':''"> 到店自提 </view>
    </view>
    <!-- 地址 -->
    <view class="address">
      <image src="../../static/icon/order/location.png" />
      <view class="address-info">
        <view class="phone"> 苏萌 15236242999 </view>
        <view class="address-text">
          湖南省 长沙市 岳麓区 麓谷街道 麓谷企业广场B3栋8楼 8100室
        </view>
      </view>
      <image src="../../static/icon/order/right.png" />
    </view>
  </view>
</template>

<script setup>
  import { ref } from 'vue';
  const takeType = ref('1')
  const typeClick = (index) => {
    takeType.value = index
  }
</script>

<style lang="scss" scoped>
  .order-confirm {
    padding: 8px 12px;
    // 配送方式
    .take-type {
      position: relative;
      height: 40px;
      border-radius: 10px;
      padding: 8px 54px;
      box-sizing: border-box;
      font-weight: 400;
      font-size: 16px;
      color: #333333;
      display: flex;
      justify-content: space-between;
      background-color: #fff;
      &::before {
        position: absolute;
        top: 50%;
        right: 50%;
        transform: translate(-50%, -50%);
        display: block;
        content: '';
        height: 24px;
        width: 1px;
        background-color: #D8D8D8;
      }
      .a-type {
        color: #FF3B1E;
      }
    }
    // 地址
    .address {
      padding: 16px 10px;
      box-sizing: border-box;
      background-color: #fff;
      margin-top: 10px;
      border-radius: 10px;
      display: flex;
      image {
        width: 20px;
        height: 20px;
        margin-right: 5px;
        &:nth-last-of-type(1) {
          width: 16px;
          height: 16px;
        }
      }
      .address-info {
        font-weight: 400;
        font-size: 14px;
        color: #333333;
        line-height: 17px;
        .phone {
          margin-bottom: 5px;
        }
      }
    }
  }
</style>
